home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / include / ewl / ewl_progressbar.h < prev    next >
C/C++ Source or Header  |  2006-01-09  |  2KB  |  76 lines

  1.  
  2. #ifndef __EWL_PROGRESSBAR_H__
  3. #define __EWL_PROGRESSBAR_H__
  4.  
  5. /**
  6.  * @file ewl_progressbar.h
  7.  * @defgroup Ewl_Progressbar Progressbar: A progressbar from a value
  8.  * @{
  9.  */
  10.  
  11. /**
  12.  * @themekey /progressbar/file
  13.  * @themekey /progressbar/group
  14.  * @themekey /bar/file
  15.  * @themekey /bar/group
  16.  */
  17.  
  18. /**
  19.  * The Ewl_Progressbar provides a statusbar from a given value
  20.  */
  21. typedef struct Ewl_Progressbar Ewl_Progressbar;
  22.  
  23. /**
  24.  * @def EWL_PROGRESSBAR(seeker)
  25.  * Typecasts a pointer to an Ewl_Progressbar pointer.
  26.  */
  27. #define EWL_PROGRESSBAR(progressbar) ((Ewl_Progressbar *) progressbar)
  28.  
  29. /**
  30.  * @struct Ewl_Progressbar
  31.  * Inherits from Ewl_Container and creates an internal Ewl_Widget, the
  32.  * statusbar itself.
  33.  * 
  34.  */
  35. struct Ewl_Progressbar
  36. {
  37.     Ewl_Container    container;  /**< Inherit from Ewl_Container */
  38.     Ewl_Widget      *bar;       /**< The moving bar on top */
  39.     Ewl_Widget      *label;     /**< text label on the bar */
  40.     double           value;      /**< current value of the progressbar */
  41.     double           range;      /**< the maximum range of the progressbar */
  42.     int              auto_label;  /**< flag if user is setting label or not */
  43. };
  44.  
  45.  
  46. Ewl_Widget     *ewl_progressbar_new(void);
  47. int             ewl_progressbar_init(Ewl_Progressbar *p);
  48.  
  49. void          ewl_progressbar_value_set(Ewl_Progressbar *p, double v);
  50. double          ewl_progressbar_value_get(Ewl_Progressbar *p);
  51.  
  52. void          ewl_progressbar_range_set(Ewl_Progressbar *p, double r);
  53. double          ewl_progressbar_range_get(Ewl_Progressbar *p);
  54.  
  55. void          ewl_progressbar_label_set(Ewl_Progressbar *p, char *label);
  56. void          ewl_progressbar_custom_label_set(Ewl_Progressbar *p, 
  57.                             char *format_string);
  58.  
  59. void          ewl_progressbar_label_show(Ewl_Progressbar *p);
  60. void          ewl_progressbar_label_hide(Ewl_Progressbar *p);
  61.  
  62. /*
  63.  * Internally used callbacks, override at your own risk.
  64.  */
  65. void ewl_progressbar_configure_cb(Ewl_Widget *w, void *ev_data,
  66.                   void *user_data);
  67. void ewl_progressbar_child_show_cb(Ewl_Container *c, Ewl_Widget *w);
  68. void ewl_progressbar_child_resize_cb(Ewl_Container *c, Ewl_Widget *w, int size,
  69.                      Ewl_Orientation o);
  70.  
  71. /**
  72.  * @}
  73.  */
  74.  
  75. #endif                /* __EWL_PROGRESSBAR_H__ */
  76.